{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import sys \n",
    "\n",
    "# Modify the path \n",
    "sys.path.append(\"..\")\n",
    "\n",
    "import pandas as pd\n",
    "import yellowbrick as yb\n",
    "import matplotlib.pyplot as plt\n",
    " \n",
    "from sklearn.datasets import load_diabetes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "\n",
    "from yellowbrick.base import Visualizer\n",
    "from yellowbrick.exceptions import YellowbrickValueError\n",
    "\n",
    "\n",
    "##########################################################################\n",
    "## TargetVisualizer Base Class\n",
    "##########################################################################\n",
    "\n",
    "class TargetVisualizer(Visualizer):\n",
    "    \"\"\"\n",
    "    The base class for target visualizers, generic enough to support any\n",
    "    computation on a single vector, y. This Visualizer is based on the\n",
    "    LabelEncoder in sklearn.preprocessing, which only accepts a target y.\n",
    "    \"\"\"\n",
    "\n",
    "    def fit(self, y):\n",
    "        \"\"\"\n",
    "        Fit the visualizer to the target y. Note that this visualizer breaks\n",
    "        the standard estimator interface, and therefore cannot be used inside\n",
    "        of pipelines, but must be used separately; similar to how the\n",
    "        LabelEncoder is used.\n",
    "        \"\"\"\n",
    "        raise NotImplementedError(\n",
    "            \"target visualizers must implement a fit method\"\n",
    "        )\n",
    "\n",
    "\n",
    "##########################################################################\n",
    "## Balanced Binning Reference\n",
    "##########################################################################\n",
    "\n",
    "class BalancedBinningReference(TargetVisualizer):\n",
    "    \"\"\"\n",
    "    BalancedBinningReference generates a histogram with vertical lines\n",
    "    showing the recommended value point to bin your data so they can be evenly\n",
    "    distributed in each bin.\n",
    "\n",
    "    Parameters\n",
    "    ----------\n",
    "    ax : matplotlib Axes, default: None\n",
    "        This is inherited from FeatureVisualizer and is defined within\n",
    "        ``BalancedBinningReference``.\n",
    "\n",
    "    target : string, default: \"Frequency\"\n",
    "        The name of the ``y`` variable\n",
    "\n",
    "    bins : number of bins to generate the histogram, default: 4\n",
    "\n",
    "    kwargs : dict\n",
    "        Keyword arguments that are passed to the base class and may influence\n",
    "        the visualization as defined in other Visualizers.\n",
    "        \n",
    "    Attributes\n",
    "    ----------\n",
    "    bin_edges : binning reference values\n",
    "\n",
    "    Examples\n",
    "    --------\n",
    "    >>> visualizer = BalancedBinningReference()\n",
    "    >>> visualizer.fit(y)\n",
    "    >>> visualizer.show()\n",
    "\n",
    "\n",
    "    Notes\n",
    "    -----\n",
    "    These parameters can be influenced later on in the visualization\n",
    "    process, but can and should be set as early as possible.\n",
    "    \"\"\"\n",
    "\n",
    "    def __init__(self, ax=None, target=None, bins=4, **kwargs):\n",
    "\n",
    "        super(BalancedBinningReference, self).__init__(ax, **kwargs)\n",
    "\n",
    "        self.target = target\n",
    "        self.bins = bins\n",
    "\n",
    "    def draw(self, y, **kwargs):\n",
    "        \"\"\"\n",
    "        Draws a histogram with the reference value for binning as vertical\n",
    "        lines.\n",
    "\n",
    "        Parameters\n",
    "        ----------\n",
    "        y : an array of one dimension or a pandas Series\n",
    "        \"\"\"\n",
    "\n",
    "        # draw the histogram\n",
    "        hist, bin_edges = np.histogram(y, bins=self.bins)\n",
    "        self.bin_edges_ = bin_edges\n",
    "        self.ax.hist(y, bins=self.bins, color=kwargs.pop(\"color\", \"#6897bb\"), **kwargs)\n",
    "\n",
    "        # add vetical line with binning reference values\n",
    "        plt.vlines(bin_edges,0,max(hist),colors=kwargs.pop(\"colors\", \"r\"))\n",
    "\n",
    "    def fit(self, y, **kwargs):\n",
    "        \"\"\"\n",
    "        Sets up y for the histogram and checks to\n",
    "        ensure that ``y`` is of the correct data type.\n",
    "        Fit calls draw.\n",
    "\n",
    "        Parameters\n",
    "        ----------\n",
    "        y : an array of one dimension or a pandas Series\n",
    "\n",
    "        kwargs : dict\n",
    "            keyword arguments passed to scikit-learn API.\n",
    "\n",
    "        \"\"\"\n",
    "\n",
    "        #throw an error if y has more than 1 column\n",
    "        if y.ndim > 1:\n",
    "            raise YellowbrickValueError(\"y needs to be an array or Series with one dimension\") \n",
    "\n",
    "        # Handle the target name if it is None.\n",
    "        if self.target is None:\n",
    "            self.target = 'Frequency'\n",
    "\n",
    "        self.draw(y)\n",
    "        return self\n",
    "\n",
    "\n",
    "    def show(self, **kwargs):\n",
    "        \"\"\"\n",
    "        Creates the labels for the feature and target variables.\n",
    "        \"\"\"\n",
    "\n",
    "        self.ax.set_xlabel(self.target)\n",
    "        self.finalize(**kwargs)\n",
    "\n",
    "    def finalize(self, **kwargs):\n",
    "        \"\"\"\n",
    "        Finalize executes any subclass-specific axes finalization steps.\n",
    "        The user calls show and show calls finalize.\n",
    "\n",
    "        Parameters\n",
    "        ----------\n",
    "        kwargs: generic keyword arguments.\n",
    "\n",
    "        \"\"\"\n",
    "\n",
    "        for tk in self.ax.get_xticklabels():\n",
    "            tk.set_visible(True)\n",
    "            \n",
    "        for tk in self.ax.get_yticklabels():\n",
    "            tk.set_visible(True)\n",
    "        \n",
    "        \n",
    "##########################################################################\n",
    "## Quick Method\n",
    "##########################################################################\n",
    "        \n",
    "def balanced_binning_reference(y, ax=None, target='Frequency', bins=4, **kwargs):\n",
    "    \n",
    "    \"\"\"\n",
    "    BalancedBinningReference generates a histogram with vertical lines\n",
    "    showing the recommended value point to bin your data so they can be evenly\n",
    "    distributed in each bin.\n",
    "\n",
    "    Parameters\n",
    "    ----------\n",
    "    y : an array of one dimension or a pandas Series\n",
    "    \n",
    "    ax : matplotlib Axes, default: None\n",
    "        This is inherited from FeatureVisualizer and is defined within\n",
    "        ``BalancedBinningReference``.\n",
    "\n",
    "    target : string, default: \"Frequency\"\n",
    "        The name of the ``y`` variable\n",
    "\n",
    "    bins : number of bins to generate the histogram, default: 4\n",
    "\n",
    "    kwargs : dict\n",
    "        Keyword arguments that are passed to the base class and may influence\n",
    "        the visualization as defined in other Visualizers.\n",
    "\n",
    "    \"\"\"\n",
    "\n",
    "    # Initialize the visualizer\n",
    "    visualizer = BalancedBinningReference(ax=ax, bins=bins, target=target, **kwargs)\n",
    "    \n",
    "    # Fit and show the visualizer\n",
    "    visualizer.fit(y)\n",
    "    visualizer.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def balanced_binning_reference():\n",
    "    # Load a regression data set\n",
    "    data = load_diabetes()\n",
    "\n",
    "    # Extract the target variable\n",
    "    y = data['target']\n",
    "\n",
    "    # Instantiate and fit the visualizer\n",
    "    visualizer = BalancedBinningReference()\n",
    "    visualizer.fit(y)\n",
    "    return visualizer.show()\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAEFCAYAAADzHRw3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAFRVJREFUeJzt3X+QXWd93/H3SvZdGbLW8Mv8aCFKQv0NzQZBboNdjCzN1MQ4/DB165IhYBKnQF214MDUBBAlyWCoM2CKacCMjFGgUAg2zoBTxx7XtZEN1PbFKNlivi4Cx8zEtCAqWwT5XqTd/nHOOrfyrvfes1e+ex+9XzMen/OcX999Rvrso+fec87UwsICkqTJt27cBUiSRsNAl6RCGOiSVAgDXZIKcdy4LtzpdKaBXwXuBw6Pqw5JmjDrgacDd7Tb7W7/hrEFOlWY7x7j9SVpkm0Bbu1vGGeg3w9w8skn02q1xljG0ubm5pidnR13GY1Mcu0w2fVPcu0w2fUfK7X3ej3uueceqDO03zgD/TBAq9Vienp6jGUsb63WNYhJrh0mu/5Jrh0mu/5jrPZHTFX7oagkFcJAl6RCGOiSVAgDXZIKYaBLUiEG+pZLRJwCXJKZ2yLiJGAn8ASqL7ifl5l7I+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68KWR8WuLKtW3gCdGxJZ6/XzgM/Vo+lsR8Yq6/dV9x/yQvxt5v7Kv/Sbq0XREPB34S+BZj3LtLwPnRMTxEfE4qnn6v5eZP6F6CcN7cbpFR4GBriLVo99zgQ9ExF9SzVn/Tr35POAtEXEX1au+Fn0U2Frvfxpwf93+B8AJETFHFe4XZebeR7n2NVSPQf061Tz+h+rn7AN8FnhwAp7eqQnk0xZ1TKunQ27OzE2PwbXWU025/J/MvPRoX0/HHufQpcfOnVTTOq9YaUepCUfoklQI59AlqRAGuiQVwkCXpEIY6JJUCANdkgrx/wAqdgJBG3nSpQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "balanced_binning_reference()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
